package com.yygo.configentity.attachment;

import java.util.Arrays;

/**
 * Created by huanli on 2015/11/12.
 */
public class RoleAttachment {
    private String status;
    private String[] phases;
    private boolean allPhase;
    private String attachmentKey;
    private String type;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String[] getPhases() {
        return phases;
    }

    public void setPhases(String[] phases) {
        this.phases = phases;
    }

    public boolean isAllPhase() {
        return allPhase;
    }

    public void setAllPhase(boolean allPhase) {
        this.allPhase = allPhase;
    }

    public String getAttachmentKey() {
        return attachmentKey;
    }

    public void setAttachmentKey(String attachmentKey) {
        this.attachmentKey = attachmentKey;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean hasPhase(String phase){
        if(allPhase) return true;
        else return Arrays.asList(phases).contains(phase);
    }
}
